<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Conflict Sets
</TITLE>
</HEAD>
<BODY >
<A HREF="libman067.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman064.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman069.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc152">10.4</A>&nbsp;&nbsp;Conflict Sets</H2>

Given a tentative assignment, there are two kinds of conflicts that
can occur:
<UL CLASS="itemize"><LI CLASS="li-itemize">
Untenable variables
<LI CLASS="li-itemize">Violated constraints
</UL>
To obtain a tentative assignment which is a solution to the given problem,
both kinds of conflicts must be repaired.
The repair library supports this task by dynamically maintaining
conflict sets.
Typically, a search algorithm examines the conflict set(s) and attempts
to repair the tentative assignment such that the conflicts disappear.
When all conflict sets are empty, a solution is found.<BR>
<BR>

<H4 CLASS="subsubsection">conflict_vars(-Vars)</H4>
<A NAME="@default388"></A>
<A NAME="@default389"></A>
When a variable becomes untenable, it appears in the set of conflict
variable, when it becomes tenable, it disappears.
This primitive returns the list of all currently untenable variables.
Note that all these variables must be reassigned in any solution
(there is no other way to repair untenability).
Variable reassignment can be achieved
by changing the variable's tentative value with tent_set/2,
or by instantiating the variable.
Care should be taken whilst implementing repairs through tentative
value changes since this is a non-monotonic operation: conflicting repairs
may lead to cycles and the computation may not terminate. <BR>
<BR>

<H4 CLASS="subsubsection">conflict_constraints(+ConflictSet, -Constraints)</H4>
<A NAME="@default390"></A>
<A NAME="@default391"></A>
When a repair constraint goes into conflict (i.e. when it does not satisfy
the tentative assignment of its variables), it appears in a conflict set,
once it satisfies the tentative assignment, it disappears.
This primitive returns the list of all current conflict constraints
in the given conflict set.
<B>ConflictSet</B> is the conflict set name (or handle) which has
been used in the corresponding constraint annotation. For example
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
conflict_constraints(cap_cstr, Conflicts)
</PRE></BLOCKQUOTE>
would retrieve all constraints that were annotated with <CODE>cap_cstr</CODE>
and are currently in conflict.<BR>
<BR>
At least one variable within a conflict constraint must be reassigned
to get a repaired solution.
Variable reassignment can be achieved
by changing the variable's tentative value with tent_set/2,
or by instantiating the variable.
Care should be taken whilst implementing repairs through tentative
value changes since this is a non-monotonic operation: conflicting repairs
may lead to cycles and the computation may not terminate. <BR>
<BR>
Note that any repair action can change the conflict set,
therefore <A HREF="../bips/lib/repair/conflict_constraints-2.html"><B>conflict_constraints/2</B></A><A NAME="@default392"></A> should be called again after
a change has been made, in order to obtain an up-to-date conflict set.<BR>
<BR>

<H4 CLASS="subsubsection">poss_conflict_vars(+ConflictSet, -Vars)</H4>
<A NAME="@default393"></A>
The set of variables within the conflict constraints.
This is generally a mixture of tenable and untenable variables.<BR>
<BR>
<HR>
<A HREF="libman067.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman064.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman069.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
